<! DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>统计成绩最大值最小值</title>
</head>
<body>
<script>
    var i=prompt('请输入5科成绩:')
    var arr=new Array();
    var arr=new Array(5);
    var arr=new Array(i);
    var sum=0;
    var max=min=arr[0];
    for(var i=0;i<arr.length;i++){
    sum +=arr[i];
    if(arr[i]>max){
        max=arr[i];
    }
    if(arr[i]<min){
        min=arr[i];
    }
    console.log(sum);
}
    document.write('5门成绩分别是:'+ arr +'<br/>');
    document.write('总分是:'+ sum +'<br/>');
    document.write('平均分:'+ (sum/5) +'<br/>');
    document.write('最高分:'+ max +'<br/>');
    document.write('最低分:'+ min);

</script>
</body>
</html>